package com.itheima.demo01体验JDBC;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class Dmo01 {
    public static void main(String[] args) throws Exception {
        // 1.注册驱动
        // 2.获取连接
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql_day2", "root", "root");
        System.out.println(conn);

        // 3.获取Statement
        Statement stmt = conn.createStatement(); // 小货车

        // 4.增加数据
        stmt.executeUpdate("INSERT INTO st2 (NAME, age) VALUES ('抗得住', 22);");

        // 5.释放资源
        stmt.close();
        conn.close();
    }
}
